import lejos.robotics.subsumption.Behavior;

public class OffLine implements Behavior {
  private LineBot me;
  private boolean isSuppressed = false;

  public OffLine(LineBot me) {
    this.me = me;
  }
  
  public boolean takeControl() {
    return true;
  }
  
  public void action() {
    System.out.println("OffLine");
    isSuppressed = false;
    me.toggleDirection();
    me.spiral();
    while (!isSuppressed) {}
  }
  
  public void suppress() {
    isSuppressed = true;
  }
}